<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<div align="center">
<ui:composition template="../../templates/template.xhtml">

	<ui:define name="title">
	 	General Case Details Page
	</ui:define>
	<ui:param name="page" value="home" />
	<ui:define name="header">
		<ui:include src="../../header.xhtml" />
	</ui:define>

	<ui:define name="menu">
		<h:form id="menu1">

			<div id="div" align="center"><br />
				<br />
				<h:commandButton value="Back" action="#{adminCaseDetailsPage.back}"
					styleClass="buttonClass" immediate="true" /> <br />
				<br />
	
				<script type="text/javascript">
					function confirmBox() {
						var message = "Are you sure that you want to delete this case?";
						
						var return_value = confirm(message);
						
						if (return_value == true) {
							document.getElementById("menu1:confirmBox").value = "deleteCase";
						} else {
							document.getElementById("menu1:confirmBox").value = "dontDelete";
						}
					}
				</script> 
				<h:commandButton id="deleteButton" value="Delete Case"
					action="#{adminCaseDetailsPage.deleteCase}" styleClass="buttonClass"
					onclick="confirmBox()" /> 
				<h:inputHidden id="confirmBox"
					value="#{adminCaseDetailsPage.confirmBox}" /> 
				<h:message
					for="deleteButton" styleClass="error" />
			</div>
		</h:form>
		<h:form>
			<h:commandButton value="Edit GAJE Participants"
				action="#{adminCaseDetailsPage.editParticipants}"
				styleClass="buttonClass" immediate="true" />
		</h:form>
		<h:form>
			<h:commandButton value="Update Sustain Parties"
				action="#{adminCaseDetailsPage.updateParties}"
				styleClass="buttonClass" immediate="true" />
		</h:form>
		<div align="center"><br />
			<h:column>Rejection Reason:&nbsp; </h:column> <h:outputText
				value="#{adminCaseDetailsPage.caseRecord.rejectionReason}" /> <br />
			</div>
		<h:form>
			<div align="center"><br />
			<h:column>Select new status for OCSS case:&nbsp; </h:column> <h:outputText
				value="#{adminCaseDetailsPage.OCSSCaseNumber}" /> <br />
			<br />
			<h:selectOneListbox id="caseRecordStatus"
				binding="#{adminCaseDetailsPage.caseRecordStatusDescriptionUI}"
				required="true" immediate="true" size="6" /> <br />
			<br />
			<h:commandButton id="changeCaseRecordStatus" value="Change Status"
				action="#{adminCaseDetailsPage.updateCaseRecordByStatus}" /> <h:column>
				<h:message for="caseRecordStatus" styleClass="error" />
			</h:column></div>
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
		</h:form>
		<h:form id="menu2">
			<div align="center"><br />
			<br />
			<h:column
				rendered="#{adminCaseDetailsPage.renderDocumentStatusListBox}"> Select a new status for the document </h:column>
			<h:outputText
				rendered="#{adminCaseDetailsPage.renderDocumentStatusListBox}"
				value="#{adminCaseDetailsPage.docTitle}" /> <br />
			<br />
			<h:selectOneListbox
				rendered="#{adminCaseDetailsPage.renderDocumentStatusListBox}"
				id="documentStatus" required="true" immediate="true" size="6"
				binding="#{adminCaseDetailsPage.documentStatusDescriptionUI}" /> <br />
			<br />
			<h:commandButton
				rendered="#{adminCaseDetailsPage.renderDocumentStatusListBox}"
				id="changeDocumentStatus" value="Change Document Status"
				action="#{adminCaseDetailsPage.updateDocumentStatus}" /> <h:column>
				<h:message for="documentStatus" styleClass="error" />
			</h:column> <br />
			</div>
		</h:form>

		<h:form id="menu3">
			<div align="center"><br />
			Enter a new OCSS case number here: <br />
			<h:inputText value="#{adminCaseDetailsPage.newOcssCaseNumber}" /> <br />
			<h:commandButton value="Update"
				action="#{adminCaseDetailsPage.updateOcssCaseNumber}" /></div>
		</h:form>
	</ui:define>

	<ui:define name="body">
		<h:form>
			<div class="allPeopleHolder"><h:panelGrid columns="2">
				<h:outputLabel value="Filer Name:" styleClass="header" />
				<h:outputLabel value="#{adminCaseDetailsPage.filerName}" />
				<h:outputLabel value="DIVISION:" />
				<h:outputLabel value="Superior Court: Civil Division" />
			</h:panelGrid> <h:panelGrid columns="2" styleClass="tablehead">
				<h:outputLabel value="Case Category:" />
				<h:outputLabel value="Dom Rel: Child Supp./URESA/UIFSA" />
				<h:outputLabel value="Case Filing Type:" />
				<h:outputLabel value="Superior Domestic Case" />
				<h:outputLabel value="Case Type: " />
				<h:outputLabel value="Complaint/Petition" />
				<h:outputLabel value="Case Caption: " />
				<h:outputLabel value="#{adminCaseDetailsPage.caseCaption}" />
				<h:outputLabel value="uuid:" />
				<h:outputLabel value="#{adminCaseDetailsPage.uuid}" />
				<h:outputText value="OCSS Case Number: " />
				<h:outputText value="#{adminCaseDetailsPage.OCSSCaseNumber}" />
				<h:outputText value="Court Case Number: " />
				<h:outputText value="#{adminCaseDetailsPage.courtCaseNumber}" />
				<h:outputLabel value="Status:" />
				<h:outputText value="#{adminCaseDetailsPage.status}" />
				<h:outputText value="Court Date: " />
				<h:outputText value="#{adminCaseDetailsPage.courtDate}">
					<f:convertDateTime dateStyle="long" timeZone="America/New_York"
						type="date" />
				</h:outputText>
				<h:outputText value="Jurisdiction: " />
				<h:outputText value="#{adminCaseDetailsPage.jurisdiction}" />
			</h:panelGrid></div>
			<br />
			<!-- *************************Case Participants*****************************-->
			<h:outputText value="CASE PARTICIPANTS" styleClass="header" />

			<div class="grouping"><h:outputText
				value="Initiating Party Organization" styleClass="subHeadingClass" />
			<h:panelGroup>
				<h:dataTable width="100%" styleClass="celldata"
					value="#{adminCaseDetailsPage.initiatingPartyOrganizationDataModel}"
					var="initiatingPartyOrganization"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>

						<h:outputText
							value="#{initiatingPartyOrganization.organizations.name}"
							styleClass="textFont75" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>

						<h:dataTable styleClass="celldata"
							value="#{initiatingPartyOrganization.organizations.addresses}"
							var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />

									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />

									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>
			<!-- ******************************************************************-->
			<div class="grouping"><h:outputText
				value="Initiating Party Person" styleClass="subHeadingClass" /> <h:panelGroup>
				<h:dataTable width="100%" styleClass="celldata"
					value="#{adminCaseDetailsPage.initiatingPartyPersonModel}"
					var="initiatingPartyPerson"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{initiatingPartyPerson.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>
			<!-- ****************************Defendent Party Person******************-->
			<div class="grouping"><h:outputText value="Defendant Party"
				styleClass="subHeadingClass" /> <h:panelGroup>
				<h:dataTable width="100%" styleClass="celldata"
					value="#{adminCaseDetailsPage.defendentPartyPersonModel}"
					var="defendentParty"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{defendentParty.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:dataTable width="100%"
							value="#{defendentParty.person.addresses}" var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>
			<!-- *****************************Witness************************************* -->
			<div class="grouping"><h:panelGroup>
				<h:outputText value="Witness" styleClass="subHeadingClass" />
			</h:panelGroup> <h:panelGroup>
				<h:dataTable id="DATATABLE_witness" width="100%"
					styleClass="celldata"
					value="#{adminCaseDetailsPage.witnessPersonModel}" var="witness"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{witness.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{witness.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{witness.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value="#{witness.person.suffixName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:dataTable value="#{witness.person.addresses}" var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>
			<!-- ********************************Plaintiff's Attorney*************************** -->
			<div class="grouping"><h:panelGroup>
				<h:outputText value="Plaintiff's Attorney"
					styleClass="subHeadingClass" escape="true" />
			</h:panelGroup> <h:panelGroup>
				<h:dataTable id="DATATABLE_plantiff" width="100%"
					value="#{adminCaseDetailsPage.plantiffsAttorneyModel}"
					var="plantiff" styleClass="celldata"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{plantiff.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="BarID" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText value="#{plantiff.person.attorney.barID}"
							styleClass="textFont75" />
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>
			<!-- ********************************Defendent's Attorney*************************** -->
			<div class="grouping"><h:panelGroup>
				<h:outputText value="Defendant's Attorney"
					styleClass="subHeadingClass" escape="true" />
			</h:panelGroup> <h:panelGroup>
				<h:dataTable id="DATATABLE_defendent" width="100%"
					styleClass="celldata"
					value="#{adminCaseDetailsPage.defendentsAttorneyModel}"
					var="defendentsAttorney"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{defendentsAttorney.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="BarID" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText value="#{defendentsAttorney.person.attorney.barID}"
							styleClass="textFont75" />
					</h:column>
				</h:dataTable>
			</h:panelGroup></div>

			<!-- *****************************Documents****************************-->
			<h:outputText value="DOCUMENTS" styleClass="header" />

			<div class="grouping"><h:outputText value="Imported Documents"
				styleClass="tablehead" /> <h:panelGrid columns="2" width="100%">
				<h:dataTable id="DATATABLE_n_documents" width="100%"
					value="#{adminCaseDetailsPage.importedDocumentsModel}"
					var="documents_imported"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Title" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:commandLink value="#{documents_imported.title}"
							action="#{adminCaseDetailsPage.viewFile}" styleClass="textFont75">
							<f:param name="title" value="#{documents_imported.title}" />
						</h:commandLink>
						<!--  		<h:panelGroup>  
								<h:outputText value="#{documents.title}" styleClass="textFont75" />							 
							</h:panelGroup> -->
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Type" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText
							value="#{documents_imported.documentInstance.description}"
							styleClass="textFont75" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Change Status"
								styleClass="subHeadingTextClass" />
						</f:facet>
						<h:commandLink value="Change Status"
							action="#{adminCaseDetailsPage.goToChildEnforcementDocumentStatusChangePage}"
							styleClass="textFont75">
							<f:param name="title" value="#{documents_imported.title}" />
						</h:commandLink>
					</h:column>
					<h:column>
                        <f:facet name="header">
                            <h:outputText value="Delete"
                                styleClass="subHeadingTextClass" />
                        </f:facet>
                        <h:commandLink value="Change Status"
                            action="#{adminCaseDetailsPage.deleteDocument}"
                            styleClass="textFont75">
                            <f:param name="uuid" value="#{documents_imported.uuid}" />
                        </h:commandLink>
                    </h:column>
				</h:dataTable>
			</h:panelGrid> <h:outputText value="Uploaded Documents" styleClass="tablehead" />


			<h:panelGrid columns="2" width="100%">
				<h:dataTable id="DATATABLE_n_documents" width="100%"
					value="#{adminCaseDetailsPage.uploadedDocumentsModel}"
					var="documents_uploaded"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Title" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:commandLink value="#{documents_uploaded.title}"
							action="#{adminCaseDetailsPage.viewFile}" styleClass="textFont75">
							<f:param name="title" value="#{documents_uploaded.title}" />
						</h:commandLink>
						<!--  		<h:panelGroup>  
								<h:outputText value="#{documents.title}" styleClass="textFont75" />							 
							</h:panelGroup> -->
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Type" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText
							value="#{documents_uploaded.documentInstance.description}"
							styleClass="textFont75" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Change Status"
								styleClass="subHeadingTextClass" />
						</f:facet>
						<h:commandLink value="Change Status"
							action="#{adminCaseDetailsPage.goToChildEnforcementDocumentStatusChangePage}"
							styleClass="textFont75">
							<f:param name="title" value="#{documents_uploaded.title}" />
						</h:commandLink>
					</h:column>
					<h:column>
                        <f:facet name="header">
                            <h:outputText value="Delete"
                                styleClass="subHeadingTextClass" />
                        </f:facet>
                        <h:commandLink value="Change Status"
                            action="#{adminCaseDetailsPage.deleteDocument}"
                            styleClass="textFont75">
                            <f:param name="uuid" value="#{documents_uploaded.uuid}" />
                        </h:commandLink>
                    </h:column>
				</h:dataTable>
			</h:panelGrid> <h:commandLink value="View Data File"
				action="#{adminCaseDetailsPage.viewDataFile}" styleClass="textFont75" />
			
			</div>
		</h:form>
	</ui:define>
</ui:composition></div>
</html>
